package com.example.module.shoppingCart.DO;


import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import org.springframework.validation.annotation.Validated;

import java.util.Date;

/**
 * @author ghy
 * @date 2025/08/28
 * @description 获取购物车中商品DO
 */
@Data
@Entity
@Table(name = "shoppingcart")
@Validated
public class GetShoppingCartDO {
    /*
     * 购物车Id
     * */
    @Id
    @Column(name = "shopping_cart_id")
    @NotBlank(message = "购物车ID不能为空")
    private Long shoppingCartId;

    /**
     * 商品ID
     */
    @Column(name = "goods_id")
    @NotBlank(message = "商品ID不能为空")
    private Long goodsId;
    /**
     * 商品类型ID
     */
    @Column(name = "goods_type_id")
    @NotBlank(message = "商品类型ID不能为空")
    private Long goodsTypeId;

    /*
     * 商品类型名称
     * */
    @Column(name = "goods_type_name")
    @NotBlank(message = "商品类型名称不能为空")
    private String goodsTypeName;

    /**
     * 上架用户ID
     */
    @Column(name = "user_id")
    @NotBlank(message = "上架用户ID不能为空")
    private Long userId;

    /*
     * 用户名称
     * */
    @Column(name = "user_name")
    @NotBlank(message = "用户名称不能为空")
    private String userName;

    /*
     * 用户手机号
     * */
    @Column(name = "user_phone")
    @NotBlank(message = "用户手机号不能为空")
    private String userPhone;

    /*
     * 用户性别
     * */
    @Column(name = "user_sex")
    @NotBlank(message = "用户性别不能为空")
    private String userSex;

    /**
     * 商品名称
     */
    @Column(name = "goods_name")
    @NotBlank(message = "商品名称不能为空")
    private String goodsName;

    /**
     * 商品库存数量
     */
    @Column(name = "goods_quantity")
    @NotBlank(message = "商品库存数量不能为空")
    private String goodsQuantity;

    /**
     * 商品价格
     */
    @Column(name = "goods_price")
    @NotBlank(message = "商品价格不能为空")
    private String goodsPrice;

    /**
     * 商品状态
     */
    @Column(name = "goods_state")
    @NotBlank(message = "商品状态不能为空")
    private String goodsState;

    /**
     * 商品上架时间
     */
    @Column(name = "goods_uptime")
    @NotBlank(message = "商品上架时间不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date goodsUptime;

    /**
     * 商品下架时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date goodsDowntime;

    /*
    * 商品选择数量
    * */
    @Column(name = "goods_purchase_quantity")
    private String goodsPurchaseQuantity;

    /*
    * 加入购物车的时间
    * */
    @Column(name = "shopping_add_time")
    @NotBlank(message = "加入购物车时间不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date shoppingAddTime;

    /*
    * 购物车更新时间
    * */
    @Column(name = "shopping_update_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date shoppingUpdateTime;

    /*
    * Getter and Setter
    * */

    public @NotBlank(message = "购物车ID不能为空") Long getShoppingCartId() {
        return shoppingCartId;
    }

    public void setShoppingCartId(@NotBlank(message = "购物车ID不能为空") Long shoppingCartId) {
        this.shoppingCartId = shoppingCartId;
    }

    public @NotBlank(message = "商品ID不能为空") Long getGoodsId() {
        return goodsId;
    }

    public void setGoodsId(@NotBlank(message = "商品ID不能为空") Long goodsId) {
        this.goodsId = goodsId;
    }

    public @NotBlank(message = "商品类型ID不能为空") Long getGoodsTypeId() {
        return goodsTypeId;
    }

    public void setGoodsTypeId(@NotBlank(message = "商品类型ID不能为空") Long goodsTypeId) {
        this.goodsTypeId = goodsTypeId;
    }

    public @NotBlank(message = "商品类型名称不能为空") String getGoodsTypeName() {
        return goodsTypeName;
    }

    public void setGoodsTypeName(@NotBlank(message = "商品类型名称不能为空") String goodsTypeName) {
        this.goodsTypeName = goodsTypeName;
    }

    public @NotBlank(message = "上架用户ID不能为空") Long getUserId() {
        return userId;
    }

    public void setUserId(@NotBlank(message = "上架用户ID不能为空") Long userId) {
        this.userId = userId;
    }

    public @NotBlank(message = "用户名称不能为空") String getUserName() {
        return userName;
    }

    public void setUserName(@NotBlank(message = "用户名称不能为空") String userName) {
        this.userName = userName;
    }

    public @NotBlank(message = "用户手机号不能为空") String getUserPhone() {
        return userPhone;
    }

    public void setUserPhone(@NotBlank(message = "用户手机号不能为空") String userPhone) {
        this.userPhone = userPhone;
    }

    public @NotBlank(message = "用户性别不能为空") String getUserSex() {
        return userSex;
    }

    public void setUserSex(@NotBlank(message = "用户性别不能为空") String userSex) {
        this.userSex = userSex;
    }

    public @NotBlank(message = "商品名称不能为空") String getGoodsName() {
        return goodsName;
    }

    public void setGoodsName(@NotBlank(message = "商品名称不能为空") String goodsName) {
        this.goodsName = goodsName;
    }

    public @NotBlank(message = "商品库存数量不能为空") String getGoodsQuantity() {
        return goodsQuantity;
    }

    public void setGoodsQuantity(@NotBlank(message = "商品库存数量不能为空") String goodsQuantity) {
        this.goodsQuantity = goodsQuantity;
    }

    public @NotBlank(message = "商品价格不能为空") String getGoodsPrice() {
        return goodsPrice;
    }

    public void setGoodsPrice(@NotBlank(message = "商品价格不能为空") String goodsPrice) {
        this.goodsPrice = goodsPrice;
    }

    public @NotBlank(message = "商品状态不能为空") String getGoodsState() {
        return goodsState;
    }

    public void setGoodsState(@NotBlank(message = "商品状态不能为空") String goodsState) {
        this.goodsState = goodsState;
    }

    public @NotBlank(message = "商品上架时间不能为空") Date getGoodsUptime() {
        return goodsUptime;
    }

    public void setGoodsUptime(@NotBlank(message = "商品上架时间不能为空") Date goodsUptime) {
        this.goodsUptime = goodsUptime;
    }

    public Date getGoodsDowntime() {
        return goodsDowntime;
    }

    public void setGoodsDowntime(Date goodsDowntime) {
        this.goodsDowntime = goodsDowntime;
    }

    public String getGoodsPurchaseQuantity() {
        return goodsPurchaseQuantity;
    }

    public void setGoodsPurchaseQuantity(String goodsPurchaseQuantity) {
        this.goodsPurchaseQuantity = goodsPurchaseQuantity;
    }

    public @NotBlank(message = "加入购物车时间不能为空") Date getShoppingAddTime() {
        return shoppingAddTime;
    }

    public void setShoppingAddTime(@NotBlank(message = "加入购物车时间不能为空") Date shoppingAddTime) {
        this.shoppingAddTime = shoppingAddTime;
    }

    public Date getShoppingUpdateTime() {
        return shoppingUpdateTime;
    }

    public void setShoppingUpdateTime(Date shoppingUpdateTime) {
        this.shoppingUpdateTime = shoppingUpdateTime;
    }
}
